// JavaScript Document
myconfig=new Array();
/*myconfig['api']='http://www.taohuipin.com/index.php?m=api&c=app&a=';
myconfig['url']='http://www.taohuipin.com/';*/
myconfig['api']='http://localhost/index.php?m=api&c=app&a=';
myconfig['url']='http://localhost/';

myinfo=new Array();
myinfo['random']=sessionStorage.getItem("random");
myinfo['userid']=sessionStorage.getItem("userid");
myinfo['nickname']=sessionStorage.getItem("nickname");
myinfo['groupid']=sessionStorage.getItem("groupid");
myinfo['avatar']=sessionStorage.getItem("avatar");
myinfo['phone']=sessionStorage.getItem("phone");
myinfo['email']=sessionStorage.getItem("email");
myinfo['money']=sessionStorage.getItem("money");
myinfo['point']=sessionStorage.getItem("point");
myinfo['group_name']=sessionStorage.getItem("group_name");
myinfo['phone_status']=sessionStorage.getItem("phone_status");
myinfo['email_status']=sessionStorage.getItem("email_status");
myinfo['alipay_status']=sessionStorage.getItem("alipay_status");
myinfo['name']=sessionStorage.getItem("name");
myinfo['bank_status']=sessionStorage.getItem("bank_status");
myinfo['qq']=sessionStorage.getItem("qq");
myinfo['name_status']=sessionStorage.getItem("name_status");
//更新用户信息
if(myinfo['userid'] && myinfo['random']){
    setInterval ("get_userinfor()", 10000);
}
function get_userinfor() {
    var userid=myinfo['userid'];
    var random=myinfo['random'];
    var user_list=myconfig['api']+'get_userinfo&random='+random+'&userid='+userid+'';
    $.get(user_list, {},function(datas,sta){
        if(datas.userid){
            sessionStorage.setItem("nickname", datas.nickname);
            sessionStorage.setItem("groupid", datas.groupid);
            sessionStorage.setItem("avatar", datas.avatar);
            sessionStorage.setItem("phone", datas.phone);
            sessionStorage.setItem("email", datas.email);
            sessionStorage.setItem("money", datas.money);
            sessionStorage.setItem("point", datas.point);
            sessionStorage.setItem("group_name", datas.group_name);
            sessionStorage.setItem("phone_status", datas.phone_status);
            sessionStorage.setItem("email_status", datas.email_status);
            sessionStorage.setItem("alipay_status", datas.alipay_status);
            sessionStorage.setItem("name", datas.name);
            sessionStorage.setItem("bank_status", datas.bank_status);
            sessionStorage.setItem("qq", datas.qq);
            sessionStorage.setItem("name_status", datas.name_status);
        }else{
            sessionStorage.clear();
        }

    })
}

